package com.hkfn.rfb.rfb.bean;

import com.hkfn.rfb.common.bean.BaseModel;
import com.hkfn.rfb.common.utils.StringUtils;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class RfbDataModel extends BaseModel {
    private String dataName;
    private String dataValue;
    private String dataUnit;
    private String time;
    private boolean isSelected;

    public RfbDataModel() {
    }

    public RfbDataModel(String dataName, String dataValue, String dataUnit) {
        this.dataName = dataName;
        this.dataValue = dataValue;
        this.dataUnit = dataUnit;
        //this.time = time;
    }

    public String getNameAndUnit(){
        if (StringUtils.isEmpty(dataUnit)){
            return dataName;
        }
        return dataName + "(" + dataUnit + ")";
    }
}
